package org.convallaria.framework.common.exception;

import org.convallaria.framework.common.constants.CommonConstants;

/**
 * 业务异常类
 * 
 * @author convallaria
 * @since 1.0.0
 */
public class BusinessException extends RuntimeException {
    
    private final Integer code;
    
    public BusinessException(String message) {
        super(message);
        this.code = CommonConstants.ERROR;
    }
    
    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }
    
    public BusinessException(Integer code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }
    
    public Integer getCode() {
        return code;
    }
}
